package acwing._2LanQiao._12No12;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao._12No12
 * @File : Q3417.java
 * @Author : WangRuoyu
 * @Date : 2023/3/28 10:28
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q3417 {
    static int n;
    static int[] d;
    static int sum = 0;
    static boolean[][] f;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");
        n = Integer.parseInt(words[0]);
        d = new int[n];
        words = br.readLine().split(" ");
        for (int i = 0; i < n; ++i) {
            d[i] = Integer.parseInt(words[i]);
            sum += d[i];
        }
        f = new boolean[n + 1][2 * sum + 1];
        f[0][sum] = true;
        for (int i = 1; i <= n; ++i) {
            for (int j = 0; j < 2 * sum + 1; ++j) {
                f[i][j] |= f[i - 1][j];
                if (j >= d[i-1]) f[i][j] |= f[i - 1][j - d[i-1]];
                if (j + d[i-1] < 2 * sum + 1) f[i][j] |= f[i - 1][j + d[i-1]];
            }
        }
        int res = 0;
        for (int i = sum + 1; i < 2 * sum + 1; ++i) {
            if (f[n][i]) res++;
        }
        System.out.println(res);
    }
}

// dfs 暴搜 TLE
//public class Q3417 {
//    static int n;
//    static int[] d;
//    static HashSet<Integer> set;
//    static int[] st = {-1, 0, 1};
//
//    static void dfs(int k, int res) {
//        if (k >= n) {
//            return;
//        }
//        for (int i = 0; i < 3; ++i) {
//            res += d[k] * st[i];
//            if (res > 0) {
//                set.add(res);
//            }
//            dfs(k + 1, res);
//            res -= d[k] * st[i];
//        }
//    }
//
//    public static void main(String[] args) throws IOException {
//        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        String[] words = br.readLine().split(" ");
//        n = Integer.parseInt(words[0]);
//        d = new int[n];
//        words = br.readLine().split(" ");
//        for (int i = 0; i < n; ++i) {
//            d[i] = Integer.parseInt(words[i]);
//        }
//        set = new HashSet<>();
//        int res = 0;
//        dfs(0, res);
//        System.out.println(set.size());
//    }
//}
